package com.springStudy.boot.redis.firstDemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Controller
public class FirstController {
    @Autowired
    RedisUtils redisUtils;

    //http://localhost:9080/addValue?key=away&value=test01
    @GetMapping("/addValue")
    public String addValue(@RequestParam("key") String key,@RequestParam("value") String value){
        redisUtils.setString(key,value,1000*60*60*1L);
        return "success";
    }
}
